﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using ST.Buz.Base.Entity;
using ST.Buz.Base.Enums;

namespace ST.Buz.Base.Mapping
{
	public partial class Map_IMS_FinanceRecv : IEntityTypeConfiguration<IMS_FinanceRecv>
	{
		public void Configure(EntityTypeBuilder<IMS_FinanceRecv> builder)
		{
			builder.HasKey(e => new { e.ID })
				.HasName("PK_IMS_FinanceRecv")
				.IsClustered(false);

			builder.HasIndex(e => new { e.PartnerID })
				.HasName("IX_IMS_FinanceRecv_PartnerID")
				.IsClustered(false);

			builder.Property(e => e.SNo)
				.IsUnicode(false);

			builder.Property(e => e.ShareType)
				.HasDefaultValueSql("((" + (int)FinanceShareType.不自动分配 + "))")
				.ValueGeneratedNever();

			builder.Property(e => e.TotalRecv)
				.HasColumnType("decimal(18,2)")
				.HasDefaultValueSql("((0))")
				.ValueGeneratedNever();

			builder.Property(e => e.AddDate)
				.HasDefaultValueSql("(getdate())")
				.ValueGeneratedNever();
		}
	}
}
